11110 - Equidivisions (DFS, maratón colombiana) &&
[andmenj-acm.git] / 11115 - Uncle Jack / UncleJack.java
blob531f5e1f0e3b9a181bbe1e7a9448bce4b7c37bd5
1 import java.io.*;
2 import java.util.*;
3 //import java.math.*;
6 class Main {
8 public static void main(String[] args) throws IOException {
9 Scanner cin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
10 PrintStream cout = System.out;
12 while (cin.hasNextInt()) {
13 int n = cin.nextInt();
14 int d = cin.nextInt();
15 if (n + d == 0) throw new IOException();
16 // BigInteger b = new BigInteger(String.valueOf(n));
17 // b = b.pow(d);
18 // cout.printf("%s\n", (b.toString()));
19 cout.printf("%.0f\n", Math.pow(n, d));
26 class Main
28 static BufferedReader stdin;
29 static PrintWriter stdout;
31 public static void main(String[] ss) throws Exception
33 Reader rdr = new InputStreamReader(System.in);
34 stdin = new BufferedReader(rdr);
35 Writer wtr = new OutputStreamWriter(System.out);
36 wtr = new BufferedWriter(wtr);
37 stdout = new PrintWriter(wtr);
39 (new Main()).run();
40 stdout.close();
43 void run() throws Exception
45 StringTokenizer t = new java.util.StringTokenizer(stdin.readLine());
46 int n = Integer.parseInt(t.nextToken());
47 int d = Integer.parseInt(t.nextToken());
48 while (n + d != 0){
49 BigInteger b = new BigInteger(String.valueOf(n));
50 b = b.pow(d);
51 stdout.println(b.toString());
52 t = new java.util.StringTokenizer(stdin.readLine());
53 n = Integer.parseInt(t.nextToken());
54 d = Integer.parseInt(t.nextToken());